package com.lvmama.pangolin.qnr.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.lvmama.pangolin.entity.qnr.QNRTicketProductItem;
import com.lvmama.pangolin.entity.qnr.QNRTicket_Commodity;
import com.lvmama.pangolin.mybatis.mapper.qnr.QNRTicketProductItemsMapper;
import com.lvmama.pangolin.qnr.service.QNRTicketProductItemsService;
@Transactional
@Service
public class QNRTicketProductItemsServiceImpl implements QNRTicketProductItemsService{
	/**  
	* @Title：TCProductItemsServiceImpl.java
	* @Author:zhoutianqi
	* @Description:
	* @Date：2017年3月6日下午4:27:26  
	*/
	@Autowired
	private QNRTicketProductItemsMapper qnrProductItemsMapper;
	public int insert(QNRTicket_Commodity item)throws Exception{
		return qnrProductItemsMapper.insert(item);
	}
	public QNRTicketProductItem selectById(String id)throws Exception{
		return qnrProductItemsMapper.selectById(id);
	}
	public int update(QNRTicket_Commodity item)throws Exception{
		return qnrProductItemsMapper.update(item);
	}
	@Override
	public List<QNRTicketProductItem> selectByLimitNum(int page, int pageSize) {
		PageHelper.startPage(page, pageSize,"product_id asc"); // 核心分页代码
		List<QNRTicketProductItem> list = qnrProductItemsMapper.selectByLimitNum();
		return list;
	}
	@Override
	public int updateByItem(QNRTicketProductItem item) {
		return qnrProductItemsMapper.updateByItem(item);
	}
}
